//
//  UITextField+ZZZCategory.m
//  zjhealth
//
//  Created by 张润东 on 2017/11/30.
//  Copyright © 2017年 amu. All rights reserved.
//

#import "UITextField+ZZZCategory.h"

@implementation UITextField (ZZZCategory)

+(UITextField*)textFieldWithPlaceholder:(NSString*)placeholder bgImageName:(id)image isPassWord:(BOOL)isPassWord
{
    UITextField*textField=[[UITextField alloc]init];
    if (placeholder) {
        textField.placeholder=placeholder;
    }
    if (image) {
        
        if ([image isKindOfClass:[NSString class]]) {
            textField.background=[UIImage imageNamed:image];
        }else if ([image isKindOfClass:[UIImage class]]){
            textField.background=image;
        }
        
    }
    
    if (isPassWord) {
        textField.secureTextEntry=YES;
    }
    
    return textField;
}
@end
